<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>护理项目列表</title>
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/js/common/bootstrap/css/bootstrap.min.css">

<!-- 可选的Bootstrap主题文件（一般不用引入） -->
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/js/common/bootstrap/css/bootstrap-theme.min.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="${pageContext.request.contextPath }/js/jquery-3.1.1.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script
	src="${pageContext.request.contextPath }/js/common/bootstrap/js/bootstrap.min.js"></script>

</head>
<body>
	<hr>
	
		<form class="form-inline" id="myform">
			<table border="0" cellspacing="0" cellpadding="10" width="100%">
				<tr>
					<td width="10%" align="right">项目编号：</td>
					<td width="10%"><input type="text" id="project_id"
						name="project_id" value="" class="form-control" /></td>
					<td width="10%" align="right">项目名称：</td>
					<td><input type="text" id="project_name" name="project_name"
						value="" class="form-control" /></td>
					<td width="60%" rowspan="2">&nbsp; &nbsp; &nbsp;
						<button class="btn btn-primary btn-sm" type="submit">
						<span class="glyphicon glyphicon-search" aria-hidden="true"></span>查询</button>
						<button type="reset" class="btn btn-primary btn-sm">
						<span class="glyphicon glyphicon-repeat" aria-hidden="true">重置</button> 
						<!--新增按钮 -->
						<a href="add" class="btn btn-primary btn-sm" role="button">
						<span class="glyphicon glyphicon-plus" aria-hidden="true">新增</a>
					</td>
				</tr>
				<tr>
					<td align="right">分类：</td>
					<td><select name="type_id" id="type_id" class="form-control">
							<option value="">全部</option>
							<c:forEach items="${tlist }" var="type">
								<option value="${type.type_id }">${type.type_name }</option>
							</c:forEach>

					</select></td>
					<td align="right">状态：</td>
					<td><select name="status" id="status" class="form-control">
							<option value="">全部</option>
							<option value="1">在售</option>
							<option value="2">下架</option>
					</select></td>

				</tr>
			</table>
		</form>

		<hr>

		<table  data-toggle="table" class="table table-condensed table-striped">
			<tr>
				<td>项目编号</td>
				<td>项目名称</td>
				<td>分类</td>
				<td>服务时长(分钟)</td>
				<td>人民币售价(元)</td>
				<td>颜值售价(个)</td>
				<td>标准手工费(元)</td>
				<td>活动手工费(元)</td>
				<td>状态</td>
				<td>更新时间</td>
				<td>排序号</td>
				<td></td>
			</tr>
			<c:forEach items="${list }" var="bis_nurse_project">
				<tr>
					<td>${bis_nurse_project.project_id }</td>
					<td>${bis_nurse_project.project_name }</td>
					<td>${bis_nurse_project.type_name }</td>
					<td>${bis_nurse_project.server_time }</td>
					<td>${bis_nurse_project.rmb_price }</td>
					<td>${bis_nurse_project.beauty_price }</td>
					<td>${bis_nurse_project.manual_price }</td>
					<td>${bis_nurse_project.active_price }</td>
					<td>${bis_nurse_project.status==1?"在售":"下架" }</td>
					<td>${bis_nurse_project.modify_time }</td>
					<td>${bis_nurse_project.sort_no }</td>
					<td>
					<a class="btn btn-primary btn-xs"
						href="del/${bis_nurse_project.project_id }" role="button">
						 <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> 删除
					</a>
					<a class="btn btn-primary btn-xs"
						href="queryById/${bis_nurse_project.project_id }" role="button">
						 <span class="glyphicon glyphicon-cog" aria-hidden="true"></span> 修改
					</a>
					<a class="btn btn-primary btn-xs"  data-toggle="modal" data-target="#myModal"
						href="selectById/${bis_nurse_project.project_id }" role="button">
						 <span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>
					</a>
					
				
					</td>

				</tr>
			</c:forEach>

</table>


<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document" style="100px">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">查看项目信息</h4>
      </div>
      <div class="modal-body">
      <iframe src="http://127.0.0.1:8081/bsc/jhy/seeBis_nurse_project">
      </iframe>
      </div>
      <div class="modal-footer">
      </div>
    </div>
  </div>
</div>

</body>
</html>
<script type="text/javascript">

$(document).ready(function() {
	$('#myform').submit(function() {	//这次我们这么绑定
		
		$.ajax({
			// ajax提交代码....
			 type:'post',  
			    url:'/bsc/jhy/nurseProject', 
			    cache: false,
			    data:data,  
			    dataType:'json', 
			    success:function(data){      
			      alert('success');
			    }
		});
			return false;	//还是要return false, 跟上面一样的道理
	});
});

</script>
